<%--
功能: 商品选择器，可多选或者单选商品
参数：
selectorId : 必填。选择器ID
multiple   ：可选。是否选择多个货品,默认false
callbackFunc ：必填。回调函数，如果multiple为false则返回参数为JSONObject{productSkuId,productSkuCode,imageUrl,productId,productName,productCode,minOrderQuantity,orderSkuDisplayOption}，否则是这些JSONObject的一个数组 
--%>
<%@ tag body-content="empty"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ attribute name="selectorId" required="true" rtexprvalue="true" type="java.lang.String" description="选择器ID"%>
<%@ attribute name="multiple"  required="false" rtexprvalue="true" type="java.lang.Boolean" description="是否选择多个货品,默认false"%>
<%@ attribute name="callbackFunc" required="true" rtexprvalue="true" type="java.lang.String" description="回调函数，如果multiple为false则返回参数为JSONObject{productSkuId,productSkuCode,imageUrl,productId,productName,productCode,minOrderQuantity,orderSkuDisplayOption}，否则是这些JSONObject的一个数组"%>

<fmt:message key="productSkuSelector.title" var="selectProductSkuTitle"/>	
<div id="divDlg${selectorId}" style="visibility:hidden;position:absolute;overflow: auto;height:620px;">
	<iframe id="${selectorId}Iframe"  name="${selectorId}Iframe" frameborder="0"  width="100%" height="620" scrolling="no">
		<!-- 放置内容 fillDiv -->
	</iframe>
</div>

<c:set var="ui_dialog" value="true" scope="request"/>
<c:set var="plugin_iframeLoader" value="true" scope="request"/>
<script type="text/javascript" >
var ui_dialog_${selectorId};
var ${selectorId}Iframe = $j("#${selectorId}Iframe")[0];
var ${selectorId}CallbackFunc = eval(${callbackFunc});;
var ${selectorId}Multiple = ${empty multiple?false:multiple};
var ${selectorId}HasLoad = false;
$j(document).ready(function(){
	ui_dialog_${selectorId} = $j("#divDlg${selectorId}"); 
}); 

<%--模拟重写打开dialog方法--%>
function showDialogOf${selectorId}()
{
	ui_dialog_${selectorId}.css("visibility","visible");
	if(!${selectorId}HasLoad){
		ui_dialog_${selectorId}.loading();
		$j(${selectorId}Iframe).src(__ctxPath + "/product/productSkuSelector/windowPage.html?selectorId=${selectorId}",function(duration){$j(${selectorId}Iframe).show();ui_dialog_${selectorId}.unloading();});
		ui_dialog_${selectorId}.dialog({ title:"${selectProductSkuTitle}", modal: true, resizable:false,height:670, width:900, bgiframe: true,overlay: { opacity: 0.5, background: "black" } });
		${selectorId}HasLoad = true;
	}	
	ui_dialog_${selectorId}.dialog("open");
	
}

<%--模拟重写关闭dialog方法--%>
function closeDialogOf${selectorId}()
{
	ui_dialog_${selectorId}.dialog("close");
}
</script>
				
	


